Fix call to XendCheckpoint.restore, since that method no longer needs a
authoremellor@ewan <emellor@ewan>
Sun, 2 Oct 2005 17:17:26 +0000 (18:17 +0100)
committeremellor@ewan <emellor@ewan>
Sun, 2 Oct 2005 17:17:26 +0000 (18:17 +0100)
XendDomain instance passed in.

Remove meaningless indirection of imports through web/reactor.py.  Tidy import
statements.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/python/xen/web/reactor.py [deleted file]
tools/python/xen/xend/server/event.py
tools/python/xen/xend/server/relocate.py

diff --git a/tools/python/xen/web/reactor.py b/tools/python/xen/web/reactor.py
deleted file mode 100644 (file)
index 2be9126..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#============================================================================
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of version 2.1 of the GNU Lesser General Public
-# License as published by the Free Software Foundation.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-#============================================================================
-# Copyright (C) 2005 Mike Wray <mike.wray@hp.com>
-#============================================================================
-
-from unix import listenUNIX, connectUNIX
-from tcp import listenTCP, connectTCP, SetCloExec
index d5b54c7053b39424523e6f31ac6838fc5c2b281a..d8a03a521f6a05a9a295e24f078dd6fcd33fc158 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #============================================================================
 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
+# Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
 import sys
 import StringIO
 
-from xen.web import reactor, protocol
+from xen.web import protocol, tcp, unix
 
 from xen.xend import scheduler
 from xen.xend import sxp
 from xen.xend import PrettyPrint
-from xen.xend import EventServer; eserver = EventServer.instance()
+from xen.xend import EventServer
 from xen.xend.XendError import XendError
-from xen.xend import XendRoot; xroot = XendRoot.instance()
+from xen.xend import XendRoot
+
+
+eserver = EventServer.instance()
+xroot = XendRoot.instance()
+
 
 DEBUG = 0
 
@@ -210,8 +216,8 @@ def listenEvent(daemon):
     factory = EventFactory(daemon)
     if xroot.get_xend_unix_server():
         path = '/var/lib/xend/event-socket'
-        reactor.listenUNIX(path, factory)
+        unix.listenUNIX(path, factory)
     if xroot.get_xend_http_server():
         port = xroot.get_xend_event_port()
         interface = xroot.get_xend_address()
-        reactor.listenTCP(port, factory, interface=interface)
+        tcp.listenTCP(port, factory, interface=interface)
index b8959baa06ad78e4e6d8e9aaf7c2c0e7fcba38a8..610c459af2dab2daa368db54182523ac6133438b 100644 (file)
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #============================================================================
 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
+# Copyright (C) 2005 XenSource Ltd
 #============================================================================
 
 import socket
 import sys
 import StringIO
 
-from xen.web import reactor, protocol
+from xen.web import protocol, tcp, unix
 
 from xen.xend import scheduler
 from xen.xend import sxp
-from xen.xend import EventServer; eserver = EventServer.instance()
+from xen.xend import EventServer
 from xen.xend.XendError import XendError
-from xen.xend import XendRoot; xroot = XendRoot.instance()
+from xen.xend import XendRoot
 from xen.xend.XendLogging import log
 from xen.xend import XendCheckpoint
 
+
+eserver = EventServer.instance()
+xroot = XendRoot.instance()
+
+
 DEBUG = 0
 
 class RelocationProtocol(protocol.Protocol):
@@ -114,8 +120,7 @@ class RelocationProtocol(protocol.Protocol):
         if self.transport:
             self.send_reply(["ready", name])
             self.transport.sock.setblocking(1)
-            xd = xroot.get_component("xen.xend.XendDomain")
-            XendCheckpoint.restore(xd, self.transport.sock.fileno())
+            XendCheckpoint.restore(self.transport.sock.fileno())
             self.transport.sock.setblocking(0)
         else:
             log.error(name + ": no transport")
@@ -136,11 +141,11 @@ def listenRelocation():
     factory = RelocationFactory()
     if xroot.get_xend_unix_server():
         path = '/var/lib/xend/relocation-socket'
-        reactor.listenUNIX(path, factory)
+        unix.listenUNIX(path, factory)
     if xroot.get_xend_relocation_server():
         port = xroot.get_xend_relocation_port()
         interface = xroot.get_xend_relocation_address()
-        l = reactor.listenTCP(port, factory, interface=interface)
+        l = tcp.listenTCP(port, factory, interface=interface)
         l.setCloExec()
 
 def setupRelocation(dst, port):